<?php if (!defined('THINK_PATH')) exit();?><?php $iscommentdel = CheckPermission('core_normal','comment_del');
$iscommentadmindel = CheckPermission('core_admin','comment_del');
$cancomment = intval(CheckPermission('core_normal','feed_comment')); ?>
<?php if(is_array($list["data"])): ?><?php $i = 0;?><?php $__LIST__ = $list["data"]?><?php if( count($__LIST__)==0 ) : echo "" ; ?><?php else: ?><?php foreach($__LIST__ as $key=>$vo): ?><?php ++$i;?><?php $mod = ($i % 2 )?><dl class="comment_list" id="comment_list_<?php echo ($vo["comment_id"]); ?>">
	<dt><a href="<?php echo ($vo["user_info"]["space_url"]); ?>"><img src="<?php echo ($vo["user_info"]["avatar_tiny"]); ?>" width="30" height="30"/></a></dt>
	<dd>
		<p class="cont"><?php echo ($vo["user_info"]["space_link"]); ?>：<em><?php if($vo['is_audit'] || $vo['uid'] == $GLOBALS['ts']['mid']): ?><?php echo (parse_html($vo["content"])); ?><?php else: ?>内容正在审核<?php endif; ?><span class="time">(<?php echo (friendlydate($vo["ctime"])); ?>)</span></em></p>
		<p class="right mt5">
			<span>
				<?php if(($vo['uid'] == $GLOBALS['ts']['mid'] && $iscommentdel ) || $iscommentadmindel): ?>
				<a href="javascript:;" onclick="deleteComment(<?php echo ($vo["comment_id"]); ?>);">删除</a>
				<?php if($cancomment == 1): ?>
				<i class="vline">|</i>
				<?php endif; ?>
				<?php endif; ?>
				<?php if($cancomment == 1): ?>
				<a href="javascript:;" onclick="replyComment('<?php echo ($vo["user_info"]["uname"]); ?>', <?php echo ($vo["user_info"]["uid"]); ?>, <?php echo ($vo["comment_id"]); ?>);">回复</a>
				<?php endif; ?>
			</span>
		</p>
	</dd>
</dl><?php endforeach; ?><?php endif; ?><?php else: echo "" ;?><?php endif; ?>
<input type="hidden" id="to_comment_id" value="0" />
<input type="hidden" id="to_uid" value="0" />

<script type="text/javascript">
/**
 * 删除微博评论
 * @return void
 */
var deleteComment = function (commentId) {
	// 淡化效果
	$('#comment_list_' + commentId).fadeOut();
	// 删除操作
	if (typeof core.comment === 'undefined') {
		core.plugFunc('comment', function () {
			core.comment.delComment(commentId);
		});
	} else {
		core.comment.delComment(commentId);
	}
};
/**
 * 回复评论操作
 * @param string uname 回复用户名称
 * @return void
 */
var replyComment = function (uname, uid, commentId) {
	if (typeof uname === 'undefined' || typeof uid === 'undefined' || typeof commentId === 'undefined') {
		return false;
	}
	$('#mini_editor_textarea').focus();
	$('#mini_editor_textarea').val('回复@' + uname + ' ：');
	$('#to_uid').val(uid);
	$('#to_comment_id').val(commentId);
	valChange();
};
</script>